﻿<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
			<form id="form" method="POST" action="<?=site_url('archive/marriage_update/'.$cateid)?>">
			<fieldset>
			<legend>结婚证信息 Marriage Certificate</legend>
			
			<label>签发单位<br>Issued Authority:</label><input type="text" name="special_seal" value="<?=@$info->special_seal?>" /> <br />  <br>
			<label>签发人<br>Issuer:</label><input type="text" name="signature" value="<?=@$info->signature?>" /> <br /> <br>
			<label>证件持有人<br>Bearer of this certification:</label><input type="text" name="holder" value="<?=@$info->holder?>" /> <br /> <br>
			<label>签发时间<br>Date of Issue:</label><input type="text" name="reg_date" id="reg_date" value="<?=@$info->reg_date?>" /> <br /> <br>
			<label>婚证字号<br>No.:</label><input type="text" name="zi_no" value="<?=@$info->zi_no?>"/> <br /><br>
			<hr />
			<label>姓名<br>Full Name:</label><input type="text" name="name1" value="<?=@$info->name1?>" /> <br /> <br>
			<label>性别<br>Sex:</label><input type="radio" name="sex1" value="1" <?= (@$info->sex1==1)?'checked':''?> />男 / Male <input type="radio" name="sex1" value="2" <?= (@$info->sex1==2)?'checked':''?> />女 / Female	<br /> <br>
			<label>国籍<br>Nationality:</label><input type="text" name="nationality1" id="nationality1" style="background:#FFFFC0; width:200px" value="<?=@$info->nationality1?>"/> <br /><br>
			<label>出生日期<br>Date of Birth:</label><input type="text" name="birth1" id="birth1" value="<?=@$info->birth1?>" /> <br /><br>
			<label>身份证号码<br>National ID Card No.,:</label><input type="text" name="idcard1" value="<?=@$info->idcard1?>"/> <br />  <br>
			<hr />
			<label>姓名<br>Full Name:</label><input type="text" name="name2" value="<?=@$info->name2?>" /> <br /> <br>
			<label>性别<br>Sex:</label><input type="radio" name="sex2" value="1" <?= (@$info->sex2==1)?'checked':''?> />男 / Male <input type="radio" name="sex2" value="2" <?= (@$info->sex2==2)?'checked':''?> />女 / Female	<br /> <br>
			<label>国籍<br>Nationality:</label><input type="text" name="nationality2" id="nationality2" style="background:#FFFFC0; width:200px" value="<?=@$info->nationality2?>"/> <br /> <br>
			<label>出生日期<br>Date of Birth:</label><input type="text" name="birth2" id="birth2" value="<?=@$info->birth2?>" /> <br /><br>
			<label>身份证号码<br>National ID card No.:</label><input type="text" name="idcard2" value="<?=@$info->idcard2?>"/> <br /> <br>
			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息 Continue" onclick="return check_date_rules()"/>
			<input id="button2" type="reset" value="重置 Cancel" />
			</fieldset>
			</form>
			</div>

		</div>
        
        <script type="text/javascript" src="js/jquery.autocomplete.pack.js"></script>
        <link type="text/css" rel="stylesheet" href="css/jquery.autocomplete.css"/>
        
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

	<script type="text/javascript">
    function check_date_rules() {
        if(convert_to_date($('#reg_date').val()).getTime() >  new Date().getTime()) {
            alert('[签发时间]不能大于[当前日期]！');
            return false;
        }   
        if(convert_to_date($('#birth1').val()).getTime() > new Date().getTime()) {
            $('#birth1').focus();
            alert('[出生日期]不能大于[当前日期]！'); 
            return false;
        }        
        if(convert_to_date($('#birth2').val()).getTime() > new Date().getTime()) {
            $('#birth2').focus();    
            alert('[出生日期]不能大于[当前日期]！');
            return false;
        }           
        return true; 
    }
       
	$().ready(function() {
	  $("#form").validate({
		rules: {
			special_seal:{
			 required:true
			},
			signature:{
			 required:true
			},
			holder:{
			 required:true
			},
			reg_date:{
			 required:true
			},
			name1:{
			 required:true
			},
			sex1:{
			 required:true
			},
			name2:{
			 required:true
			},
			sex2:{
			 required:true
			}
		}
	  });
      
    
        $.datepicker.setDefaults(
            {
            dateFormat: 'dd/mm/yy',
            readOnly: false
            }
        );
          
		$( "#reg_date" ).datepicker({
			changeMonth: true,
			changeYear: true,
			showOn: "both",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true

		});
		$( "#birth1" ).datepicker({
			changeMonth: true,
			changeYear: true,
			showOn: "both",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true

		});
		$( "#birth2" ).datepicker({
			changeMonth: true,
			changeYear: true,
			showOn: "both",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true

		});
        
        $("#nationality1").autocomplete("<?=base_url()?>user/quick_search_country", {
            minChars: 0,
            width: 500,
            matchContains: "word",
            autoFill: false,
            formatItem: function(row, i, max) {
                var arr = (row+"").split(",");
                return i + "/" + max + ": " + arr[1] + '['+ arr[2] +']';
            },
            formatMatch: function(row, i, max) {
                return row;
            },
            formatResult: function(row) {
                var arr = (row+"").split(",");
                return arr[1];
            }
        });
        
        $("#nationality2").autocomplete("<?=base_url()?>user/quick_search_country", {
            minChars: 0,
            width: 500,
            matchContains: "word",
            autoFill: false,
            formatItem: function(row, i, max) {
                var arr = (row+"").split(",");
                return i + "/" + max + ": " + arr[1] + '['+ arr[2] +']';
            },
            formatMatch: function(row, i, max) {
                return row;
            },
            formatResult: function(row) {
                var arr = (row+"").split(",");
                return arr[1];
            }
        });
	});
	</script>
	
<?=$this->load->view('include_footer',null)?>
